﻿using System.Text.RegularExpressions;

namespace GPToolkit.ExtensionsMethods
{
	public static class StringExtension
	{
		/// <summary>
		/// REGEX pattern for removing HTML tags
		/// </summary>
		private const string HTML_TAG_PATTERN = "<.*?>";

		/// <summary>
		/// Extension method that remove all HTML tags from a string
		/// </summary>
		/// <param name="value">String with HTML tags</param>
		/// <returns>String without HTML tags</returns>
		public static string StripHtml(this string value) {
			return Regex.Replace(value, HTML_TAG_PATTERN, string.Empty);
		}
	}
}
